<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%
String path = request.getContextPath();
 %>
<html>
	<head>
		<base target="_self" />
		<meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
		<title>导入客户信息</title>
		<link rel="stylesheet" type="text/css" href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
		<link rel="stylesheet" type="text/css"
			href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/jsp/base/queryCode.js"/>"></script>
		<script type="text/javascript"
			src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
		<script type="text/javascript" src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>		

 
    <script type="text/javascript">
	//添加信息按钮响应函数
	function importCustomer(){
 		$('#ImportCustomerForm').form('submit',
		{
			url:encodeURI("<c:url value='/customer/saveCustomerForExcel.do'/>"), //查询提交路径
				onSubmit:function()//提交按钮相应函数
			{
			     return $('#ImportCustomerForm').form('validate');
			},
			success:function(data){
				data = eval('(' + data + ')');
				
	       		if(data.success){
       				$.messager.alert("提示", data.msg, 'in',function(){
           				window.close();
       				});
   				}else{
       				$.messager.alert("提示", data.msg, 'warning');
   				}
			},
			error:function(){
				$.messager.alert("错误", "系统错误，请联系管理员！", 'error');
				return;
			}
		});
			
		 
	}
    </script>
   
  </head>

  <body>
	  <form id="ImportCustomerForm" name="ImportCustomerForm" method="post" enctype="multipart/form-data">
		
		  <div style="height: auto; width:1180px;background: #fafafa; padding: 5px;" class="easyui-panel" title="注意：文件格式为.xls,每次导入不能超过5万条" iconCls="icon-save" 
		  collapsible="true" minimizable="false" maximizable="false" closable="false">
			
			   <table cellpadding="5">
 			      <tr>
                  <td>excel文件:</td>
                  <td>
				  <input  type="file" name="file"  />
 			      </td>
 			      </tr>
    		   </table>
    		   <center><a class="easyui-linkbutton" onclick="window.location.href='../../customer/downloadTemplate.do'">下载模板</a>&nbsp;<a class="easyui-linkbutton" onclick="importCustomer()">导入</a><center>
 		  </div>

    </body>
</html>